<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>机构管理</title> 
<#include '/frame/version.html'> 
<#include '/frame/manage/include_css.html'> 
<#include '/frame/manage/include_js.html'> 
<#include '/frame/taglib.html'>
</head>
<body id="nv_member" class="pg_CURMODULE">
	<#assign current='menu_org_info'>
	<div id="wp" class="wp">
		<#include "/include/header.html"/>
		<div class="contentmanage">
			<div class="developer">
				<div class="tableContent">
					<#include "/include/left.html"/> <#include "/include/wxtop.html"/>
					
					<div class="content">
						<div class="cLineB">
				        <h4 class="left">
				        	机构管理
				        </h4>
				        <div class="clr">
				        </div>
						<div class="msgWrap">
						<div class="cLine">
						<div class="pageNavigator left">
								<form action="${basePath}/admin/org/index" method="post">
									<input class="px" name="orgCode" placeholder="请输入编码查询"value="${orgCode}" /> 
									<input class="btnGreen" type="submit" value="查询" />
									<input class="btnGreen" id="reset" type="reset" value="清空" />
								</form>
							</div>
							<div class="pageNavigator right">
                                <form action="${basePath}/admin/org/export" method="post" target="_self">
                            	<a class="btnGrayS" href='javascript:void(0)' id="import" onfocus="this.blur;">
                                       <img class="vm" height="20" width="20" src="${basePath}/images/import-16.png"/>&nbsp;&nbsp;导入
                                   </a>
                                    <select name="flag">
                                       <option value="0">导出当前页</option>
                                       <option value="1">导出全部</option>
                                   </select>
                                   <input type="hidden" id="eorgCode" name="orgCode" />
                                   <input type="hidden" name="currentPage" value="${page.currentPage}" />
                                   <a class="btnGrayS" href='javascript:void(0)' onclick="exportExcel(this)" onfocus="this.blur;">
                                       <img class="vm" height="20" width="20" src="${basePath}/images/export-32.png"/>&nbsp;&nbsp;导出
                                   </a>
                                   <a href="javascript:void(0)" id="add" title="新增" class="btnGrayS">
									<img width="16" src="${basePath}/images/add.png" class="vm">新增机构
								   </a>
                               </form>
                            </div>
						</div>
							<table class="ListProduct Shallow_border_color" border="0"
								cellSpacing="0" cellPadding="0" width="100%">
								<thead>
									<tr>
										<th>编号</th>
										<th>分行/支行</th>
										<th>机构代码</th>
										<th>所属上级</th>
										<th>所属地区</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<#if page?exists> <#list page.recordList as bean>
									<tr>
										<td valign="middle" align="center">${page.pernum*(page.currentPage-1)+bean_index+1}</td>
										<td>${bean.orgName}</td>
										<td>${bean.orgCode}</td>
										<td>${bean.pcode}</td>
										<td>${bean.province}${bean.city}</td>
										<td class="norightborder">
										<a href="javascript:void(0);" onclick="edit('${bean.orgInfoId}')">编辑</a>
										<a href="javascript:void(0);" onclick="del('${bean.orgInfoId}')">删除</a>
										</td>
									</tr>
									</#list> </#if>
								</tbody>
							</table>
						</div>

						<#assign formUrl="${basePath}/admin/org/index?">
						 <#include "/include/pagination.html">
					</div>
					<div class="clr"></div>
				</div>
			</div>
		</div>
		<!--底部-->
	</div>
	<!--ad start-->
	<!--ad end-->
	</div>
	</div>
	</div>
	<#include "/include/footer.html"/>
	<script>
	function del(id){
		layer.confirm("确定要删除吗？",{icon:4},function(index){
			layer.close(index);
		var $form=$("<form>" );
		$form.attr( "style","display:none" ).attr( "target","").attr( "method","post" ).attr( "action","${basePath}/admin/org/edit/2");
		$form.append("<input name='orgInfoId' type='hidden' value='"+id+"'/>");
		$form.append("<input name='token' type='hidden' value='${token}'/>");
		$("body").append($form);
		$form.submit();
		},function(index){
			layer.close(index);
		});
	}
	function edit(id){
		window.location.href="${basePath}/admin/org/toedit?id="+id;
		
		
	}
	$(function(){
		
			$("#add").click(function(){
				window.location.href="${basePath}/admin/org/toedit";
				
			});
			
			$("#reset").click(function(){
				window.location.href="${basePath}/admin/org/index";
			});
			
			$("#import").click(function(){
				window.location.href="${basePath}/admin/org/imporv";
			});
			
		});
		
	function exportExcel(that){
		$("#eorgName").attr("value",$("#orgName").val());
		$("#eorgCode").attr("value",$("#orgCode").val());
		var $form = $(that).closest("form");
		$form.submit();
	}
	</script>
</body>
</html>